//
//  ReplenishmentApi.swift
//  Pods
//
//  Created by eme on 2017/4/20.
//
//

import Foundation
import Alamofire
import ModelProtocol
import NetWorkCore
import UtilCore

/**
 快速补货路由
 */
public enum ReplenishmentApi{
    /**
     快速补货商品列表
     */
    case productrapidlist(page: Int, length: Int,brid:String,pdname:String)
    ///快速补货品牌列表
    case productrapidbrandlist(pdname:String)
    
}
extension ReplenishmentApi: TargetType {
    
    //设置请求路径
    public var path: String {
        switch self {
        case .productrapidlist:
            return "/osOrder/a/productrapidlist.json"
        case .productrapidbrandlist:
            return "/osOrder/a/productrapidbrandlist.json"
        }
    }
    
    //设置请求方式 get post等
    public var method: HTTPMethod {
        switch self {
        default :
            return .post
            
        }
    }
    /// 设置请求参数
    public var parameters: Parameters? {
        switch self {
        case let .productrapidlist(page, length,brid,pdname):
            return ["page": page, "length": length,"brid":brid,"pdname":pdname]
        case let .productrapidbrandlist(pdname):
            return ["pdname":pdname]
        }
    }
    
}
